﻿using Corina.Datamodel.Base;
using Corina.Datamodel.Interface;
using Corina.Enumerations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Runtime.Serialization;

namespace Corina.Datamodel.Entities
{
    [XmlTypeAttribute(Namespace = "http://tempuri.org/")]
    [DataContract]
    public class OverproofNotifyConfigInfo : DatamodelEntity, IOverproofNotifyConfig
    {
        #region Fields
        private int _id;
        private int _userId = 0;
        private int _specimenKindId = 0;
        private string _measureObject;
        private double _maxValue = 100;
        private string _mobile;
        private string _email;
        #endregion

        #region Properties
        [DataMember]
        public int Id
        {
            get { return _id; }
            set
            {
                _id = value;
                RaisePropertyChanged(() => Id);
            }
        }

        [DataMember]
        public int UserId
        {
            get { return _userId; }
            set
            {
                _userId = value;
                RaisePropertyChanged(() => UserId);
            }
        }

        [DataMember]
        public int SpecimenKindId
        {
            get { return _specimenKindId; }
            set
            {
                _specimenKindId = value;
                RaisePropertyChanged(() => SpecimenKindId);
            }
        }

        [DataMember]
        public string MeasureObject
        {
            get { return _measureObject; }
            set
            {
                _measureObject = value;
                RaisePropertyChanged(() => MeasureObject);
            }
        }

        [DataMember]
        public double MaxValue
        {
            get { return _maxValue; }
            set
            {
                _maxValue = value;
                RaisePropertyChanged(() => MaxValue);
            }
        }

        [DataMember]
        public string Mobile
        {
            get { return _mobile; }
            set
            {
                _mobile = value;
                RaisePropertyChanged(() => Mobile);
            }
        }

        [DataMember]
        public string Email
        {
            get { return _email; }
            set
            {
                _email = value;
                RaisePropertyChanged(() => Email);
            }
        }

        #endregion

        protected override IEnumerable<DatabaseColumn> InitColumns()
        {
            yield return new DatabaseColumn("Id", true);
            yield return new DatabaseColumn("UserId", false, true);
            yield return new DatabaseColumn("SpecimenKindId");
            yield return new DatabaseColumn("MeasureObject");
            yield return new DatabaseColumn("MaxValue");
            yield return new DatabaseColumn("Mobile");
            yield return new DatabaseColumn("Email");
        }
    }
}